<!doctype html>
[#escape x as (x)!?html]
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <title>${channel.title} - ${site.title}</title>
  <meta name="keywords" content="${channel.seoKeywords}">
  <meta name="description" content="${channel.seoDescription}">
  <meta name="_csrf" content="${_csrf.token}"/>
  <meta name="_csrf_header" content="${_csrf.headerName}"/>
  [#include 'inc_meta.html'/]
  [#include 'inc_css.html'/]
  [#include 'inc_js.html'/]
  [#if config.greyStyle]
    <style>
      body {
        filter: grayscale(.95);
        -webkit-filter: grayscale(.95);
      }
    </style>
  [/#if]
</head>
<body>
[#include 'inc_header.html'/]

<div class="container mt-3">
  <div class="row">
    <div class="col-lg-12">
      <!-- 电子资源使用记录 -->
      <div class="card">
        <div class="card-header d-flex justify-content-between align-items-center">
          <h5 class="mb-0"><i class="fas fa-database"></i> 电子资源使用记录</h5>
          <button type="button" class="btn btn-primary" onclick="showUsageDetails()">
            <i class="fas fa-chart-bar"></i> 查看统计
          </button>
        </div>
        <div class="card-body">
          <!-- 使用统计概览 -->
          <div class="row text-center mb-4">
            <div class="col-md-3">
              <h4 class="text-primary">8</h4>
              <p class="text-muted">使用数据库数</p>
            </div>
            <div class="col-md-3">
              <h4 class="text-success">45.5</h4>
              <p class="text-muted">本月使用时长(小时)</p>
            </div>
            <div class="col-md-3">
              <h4 class="text-info">156</h4>
              <p class="text-muted">文献检索次数</p>
            </div>
            <div class="col-md-3">
              <h4 class="text-warning">23</h4>
              <p class="text-muted">文献下载次数</p>
            </div>
          </div>

          <!-- 筛选条件 -->
          <div class="row mb-3">
            <div class="col-md-3">
              <select class="form-control" id="databaseFilter" onchange="filterUsage()">
                <option value="">全部数据库</option>
                <option value="cnki">中国知网</option>
                <option value="wanfang">万方数据</option>
                <option value="vip">维普资讯</option>
                <option value="springer">Springer</option>
                <option value="elsevier">Elsevier</option>
              </select>
            </div>
            <div class="col-md-3">
              <select class="form-control" id="typeFilter" onchange="filterUsage()">
                <option value="">全部类型</option>
                <option value="VIEW">查看</option>
                <option value="DOWNLOAD">下载</option>
                <option value="SEARCH">检索</option>
              </select>
            </div>
            <div class="col-md-4">
              <input type="date" class="form-control" id="startDate" placeholder="开始日期" onchange="filterUsage()">
            </div>
            <div class="col-md-2">
              <input type="date" class="form-control" id="endDate" placeholder="结束日期" onchange="filterUsage()">
            </div>
          </div>

          <!-- 使用记录列表 -->
          <div class="table-responsive">
            <table class="table table table-hover">
              <thead class="thead-light">
                <tr>
                  <th>数据库名称</th>
                  <th>访问时间</th>
                  <th>访问时长</th>
                  <th>检索关键词</th>
                  <th>文献信息</th>
                  <th>访问方式</th>
                </tr>
              </thead>
              <tbody id="usageList">
                <!-- 动态生成的使用记录 -->
              </tbody>
            </table>
          </div>
        </div>
      </div>

      <!-- 个人收藏管理 -->
      <div class="card mb-4">
        <div class="card-header d-flex justify-content-between align-items-center">
          <h5 class="mb-0"><i class="fas fa-bookmark"></i> 个人收藏管理</h5>
          <div class="btn-group btn-group-sm">
            <button type="button" class="btn btn-primary" onclick="showAddCollection()">
              <i class="fas fa-plus"></i> 添加收藏
            </button>
            <button type="button" class="btn btn-secondary" onclick="showCategoryManager()">
              <i class="fas fa-folder"></i> 分类管理
            </button>
            <button type="button" class="btn btn-info" onclick="exportCollections()">
              <i class="fas fa-download"></i> 导出收藏
            </button>
          </div>
        </div>
        <div class="card-body">
          <!-- 分类标签页 -->
          <ul class="nav nav-tabs" id="collectionTabs">
            <li class="nav-item">
              <a class="nav-link active" data-toggle="tab" href="#all">全部</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" data-toggle="tab" href="#category1">专业学习</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" data-toggle="tab" href="#category2">研究资料</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" data-toggle="tab" href="#category3">兴趣爱好</a>
            </li>
          </ul>

          <!-- 收藏内容 -->
          <div class="tab-content" id="all">
            <div class="row" id="allCollections">
              <!-- 动态生成的收藏内容 -->
            </div>
          </div>
          <div class="tab-content" id="category1">
            <div class="row" id="category1Collections">
              <!-- 动态生成的分类1收藏 -->
            </div>
          </div>
          <div class="tab-content" id="category2">
            <div class="row" id="category2Collections">
              <!-- 动态生成的分类2收藏 -->
            </div>
          </div>
          <div class="tab-content" id="category3">
            <div class="row" id="category3Collections">
              <!-- 动态生成的分类3收藏 -->
            </div>
          </div>
        </div>
      </div>

      <!-- 读书笔记管理 -->
      <div class="card mb-4">
        <div class="card-header d-flex justify-content-between align-items-center">
          <h5 class="mb-0"><i class="fas fa-sticky-note"></i> 读书笔记管理</h5>
          <button type="button" class="btn btn btn-primary animate-pulse" onclick="showNoteEditor()">
            <i class="fas fa-pen"></i> 新建笔记
          </button>
        </div>
        <div class="card-body">
          <!-- 笔记分类和搜索 -->
          <div class="row mb-3">
            <div class="col-md-3">
              <select class="form-control" id="noteTypeFilter">
                <option value="">全部类型</option>
                <option value="BOOK">图书笔记</option>
                <option value="ARTICLE">文献笔记</option>
                <option value="COURSE">课程笔记</option>
                <option value="RESEARCH">研究笔记</option>
              </select>
            </div>
            <div class="col-md-4">
              <select class="form-control" id="noteTagFilter">
                <option value="">全部标签</option>
                <option value="人工智能">人工智能</option>
                <option value="算法">算法</option>
                <option value="数据结构">数据结构</option>
                <option value="机器学习">机器学习</option>
              </select>
            </div>
            <div class="col-md-5">
              <input type="text" class="form-control" id="noteSearch" placeholder="搜索笔记内容...">
            </div>
          </div>

          <!-- 笔记列表 -->
          <div class="list-group" id="noteList">
            <!-- 动态生成的笔记列表 -->
          </div>
        </div>
      </div>

      <!-- 培训活动报名 -->
      <div class="card mb-4">
        <div class="card-header d-flex justify-content-between align-items-center">
          <h5 class="mb-0"><i class="fas fa-graduation-cap"></i> 培训活动报名</h5>
          <button type="button" class="btn btn btn-primary" onclick="showAllTraining()">
            查看全部活动
          </button>
        </div>
        <div class="card-body">
          <div class="row">
            <div class="col-md-6 mb-3">
              <div class="card">
                <div class="card-body">
                  <div class="d-flex justify-content-between align-items-start">
                    <div>
                      <h6 class="mb-1">数据库使用培训</h6>
                      <p class="text-muted small mb-2">深入学习中文数据库的使用技巧和方法</p>
                      <div class="text-muted small">
                        <i class="fas fa-calendar-alt"></i> 2024-04-28 14:00<br>
                        <i class="fas fa-map-marker-alt"></i> 电子阅览室<br>
                        <i class="fas fa-users"></i> 25/30人
                      </div>
                    </div>
                    <span class="badge badge-success">报名中</span>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-md-6 mb-3">
              <div class="card">
                <div class="card-body">
                  <div class="d-flex justify-content-between align-items-start">
                    <div>
                      <h6 class="mb-1">文献检索技巧</h6>
                      <p class="text-muted small mb-2">学习高效的文献检索方法和工具</p>
                      <div class="text-muted small">
                        <i class="fas fa-calendar-alt"></i> 2024-04-25 10:00<br>
                        <i class="fas fa-map-marker-alt"></i> 培训教室A<br>
                        <i class="fas fa-users"></i> 20/30人
                      </div>
                    </div>
                    <span class="badge badge-warning">名额已满</span>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-md-6 mb-3">
              <div class="card">
                <div class="card-body">
                  <div class="d-flex justify-content-between align-items-start">
                    <div>
                      <h6 class="mb-1">学术写作指导</h6>
                      <p class="text-muted small mb-2">提升学术论文写作能力</p>
                      <div class="text-muted small">
                        <i class="fas fa-calendar-alt"></i> 2024-05-05 14:00<br>
                        <i class="fas fa-map-marker-alt"></i> 研讨室201<br>
                        <i class="fas fa-users"></i> 15/25人
                      </div>
                    </div>
                    <span class="badge badge-info">即将开始</span>
                  </div>
                </div>
              </div>
            </div>
          </div>

          <!-- 我的报名 -->
          <h6 class="mt-4">我的报名记录</h6>
          <div class="table-responsive">
            <table class="table table-hover">
              <thead class="thead-light">
                <tr>
                  <th>活动名称</th>
                  <th>活动时间</th>
                  <th>地点</th>
                  <th>报名时间</th>
                  <th>状态</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody id="registrationList">
                <!-- 动态生成的报名记录 -->
              </tbody>
            </table>
          </div>
        </div>
      </div>

      <!-- 个性化推荐 -->
      <div class="card mb-4">
        <div class="card-header">
          <h5><i class="fas fa-magic"></i> 个性化推荐</h5>
        </div>
        <div class="card-body">
          <div class="row">
            <div class="col-md-12 mb-6">
              <h6><i class="fas fa-book text-primary"></i> 推荐图书</h6>
              <div class="list-group">
                <a href="#" class="list-group-item list-group-item-action">
                  <div class="d-flex justify-content-between">
                    <span>深度学习进阶</span>
                    <span class="badge badge-primary">92%匹配</span>
                  </div>
                </a>
                <a href="#" class="list-group-item list-group-item-action">
                  <div class="d-flex justify-content-between">
                    <span>算法设计手册</span>
                    <span class="badge badge-info">85%匹配</span>
                  </div>
                </a>
                <a href="#" class="list-group-item list-group-item-action">
                  <div class="d-flex justify-content-between">
                    <span>机器学习实战指南</span>
                    <span class="badge badge-success">78%匹配</span>
                  </div>
                </a>
              </div>
            </div>
          </div>
            <div class="col-md-12 mb-6">
              <h6><i class="fas fa-file-alt text-info"></i> 推荐文献</h6>
              <div class="list-group">
                <a href="#" class="list-group-item list-group-item-action">
                  <div class="d-flex justify-content-between">
                    <span>Transformer在NLP中的应用</span>
                    <span class="badge badge-info">Hot</span>
                  </div>
                </a>
                <a href="#" class="list-group-item list-group-item-action">
                  <div class="d-flex justify-content-between">
                    <span>BERT模型详解</span>
                    <span class="badge badge-warning">New</span>
                  </div>
                </a>
                <a href="#" class="list-group-item list-group-item-action">
                  <div class="d-flex justify-content-between">
                    <span>GPT系列发展历程</span>
                    <span class="badge badge-secondary">Trending</span>
                  </div>
                </a>
              </div>
            </div>
          </div>
            <div class="col-md-12 mb-6">
              <h6><i class="fas fa-database text-success"></i> 推荐数据库</h6>
              <div class="list-group">
                <a href="#" class="list-group-item list-group-item-action">
                  <div class="d-flex justify-content-between">
                    <span>ACM Digital Library</span>
                    <span class="badge badge-primary">推荐</span>
                  </div>
                </a>
                <a href="#" class="list-group-item list-group-item-action">
                  <div class="d-flex justify-content-between">
                    <span>IEEE Xplore</span>
                    <span class="badge badge-info">相关</span>
                  </div>
                </a>
                <a href="#" class="list-group-item list-group-item-action">
                  <div class="d-flex justify-content-between">
                    <span>SpringerLink</span>
                    <span class="badge badge-success">热门</span>
                  </div>
                </a>
              </div>
            </div>
          </div>
        </div>
      </div>


      <!-- 学习进度追踪 -->
      <div class="card mb-4">
        <div class="card-header">
          <h5 class="mb-0"><i class="fas fa-chart-line"></i> 学习进度追踪</h5>
        </div>
        <div class="card-body">
          <div class="progress mb-3" style="height: 20px;">
            <div class="progress-bar bg-success" style="width: 75%">75%</div>
          </div>
          <p class="text-center mb-2">本月学习进度</p>
          <div class="list-group list-group-flush">
            <div class="list-group-item d-flex justify-content-between">
              <span>完成学习任务</span>
              <span class="badge badge-success">18/24</span>
            </div>
            <div class="list-group-item d-flex justify-content-between">
              <span>阅读文献数量</span>
              <span class="badge badge-info">45篇</span>
            </div>
            <div class="list-group-item d-flex justify-content-between">
              <span>做笔记次数</span>
              <span class="badge badge-warning">32次</span>
            </div>
          </div>
        </div>
      </div>

      <!-- 知识点掌握情况 -->
      <div class="card mb-4">
        <div class="card-header">
          <h5 class="mb-0"><i class="fas fa-brain"></i> 知识点掌握情况</h5>
        </div>
        <div class="card-body">
          <canvas id="knowledgeChart" height="250"></canvas>
          <div class="mt-3">
            <small class="text-muted">基于您的学习活动和笔记分析生成的知识掌握情况</small>
          </div>
        </div>
      </div>

      <!-- 学习小组 -->
      <div class="card mb-4">
        <div class="card-header d-flex justify-content-between align-items-center">
          <h5 class="mb-0"><i class="fas fa-users"></i> 学习小组</h5>
          <button type="button" class="btn btn btn-primary animate-pulse" onclick="showCreateGroup()">
            <i class="fas fa-plus"></i> 创建小组
          </button>
        </div>
        <div class="card-body">
          <div class="list-group list-group-flush">
            <div class="list-group-item">
              <div class="d-flex justify-content-between">
                <div>
                  <h6 class="mb-1">机器学习学习小组</h6>
                  <small class="text-muted">5人小组 • 创建于3天前</small>
                </div>
                <button type="button" class="btn btn-sm btn-outline-info">加入</button>
              </div>
            </div>
            <div class="list-group-item">
              <div class="d-flex justify-content-between">
                <div>
                  <h6 class="mb-1">算法研究小组</h6>
                  <small class="text-muted">8人小组 • 创建于1周前</small>
                </div>
                <button type="button" class="btn btn-sm btn-outline-success">申请加入</button>
              </div>
            </div>
            <div class="list-group-item">
              <div class="d-flex justify-content-between">
                <div>
                  <h6 class="mb-1">论文写作互助组</h6>
                  <small class="text-muted">12人小组 • 创建于2周前</small>
                </div>
                <button type="button" class="btn btn-sm btn-outline-warning">邀请加入</button>
              </div>
            </div>
          </div>
        </div>
      </div>

      <!-- 项目协作 -->
      <div class="card mb-4">
        <div class="card-header">
          <h5 class="mb-0"><i class="fas fa-project-diagram"></i> 项目协作</h5>
        </div>
        <div class="card-body">
          <div class="d-grid gap-2">
            <button type="button" class="btn btn btn-primary btn-block" onclick="showCreateProject()">
              <i class="fas fa-plus"></i> 创建项目
            </button>
            <button type="button" class="btn btn btn-success btn-block" onclick="showMyProjects()">
              <i class="fas fa-folder-open"></i> 我的项目
            </button>
            <button type="button" class="btn btn btn-info btn-block" onclick="showSharedResources()">
              <i class="fas fa-share-alt"></i> 共享资源
            </button>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
[#include 'inc_footer.html'/]
<script>
// 模拟的静态数据
const resourcesData = {
  usage: [
    {
      id: 1,
      database: "中国知网",
      accessTime: "2024-04-15 14:30:00",
      duration: 45,
      searchKeywords: "人工智能",
      documentTitle: "深度学习在图像识别中的应用",
      accessType: "DOWNLOAD"
    },
    {
      id: 2,
      database: "万方数据",
      accessTime: "2024-04-15 10:15:00",
      duration: 30,
      searchKeywords: "机器学习",
      documentTitle: "机器学习实战指南",
      accessType: "VIEW"
    },
    {
      id: 3,
      database: "维普资讯",
      accessTime: "2024-04-14 16:20:00",
      duration: 60,
      searchKeywords: "数据结构",
      documentTitle: "数据结构与算法分析",
      accessType: "SEARCH"
    }
  ],
  collections: [
    {
      id: 1,
      type: "BOOK",
      title: "深度学习",
      author: "Ian Goodfellow",
      url: "/book/deep-learning",
      category: "专业学习",
      tags: ["人工智能", "机器学习"],
      createdTime: "2024-04-10",
      notes: "经典教材，值得精读"
    },
    {
      id: 2,
      type: "ARTICLE",
      title: "Transformer在NLP中的应用",
      author: "Vaswani et al.",
      url: "/article/transformer-nlp",
      category: "研究资料",
      tags: ["NLP", "Transformer", "深度学习"],
      createdTime: "2024-04-08",
      notes: "重要的NLP模型论文"
    }
  ],
  notes: [
    {
      id: 1,
      type: "BOOK",
      title: "第三章学习笔记",
      content: "本章主要介绍了神经网络的基本原理、前向传播和反向传播算法...",
      tags: ["神经网络", "深度学习"],
      createdTime: "2024-04-15",
      wordCount: 1250
    },
    {
      id: 2,
      type: "COURSE",
      title: "机器学习课程总结",
      content: "课程涵盖了监督学习、无监督学习、强化学习等内容...",
      tags: ["机器学习", "课程总结"],
      createdTime: "2024-04-12",
      wordCount: 2800
    }
  ],
  trainings: [
    {
      id: 1,
      title: "数据库使用培训",
      type: "DATABASE_TRAINING",
      description: "深入学习中文数据库的使用技巧和方法",
      speaker: "张老师",
      startTime: "2024-04-28 14:00:00",
      endTime: "2024-04-28 16:00:00",
      location: "电子阅览室",
      maxParticipants: 30,
      currentParticipants: 25,
      status: "REGISTRATION_OPEN"
    },
    {
      id: 2,
      title: "文献检索技巧",
      type: "SEARCH_TRAINING",
      description: "学习高效的文献检索方法和工具",
      speaker: "李老师",
      startTime: "2024-04-25 10:00:00",
      endTime: "2024-04-25 12:00:00",
      location: "培训教室A",
      maxParticipants: 20,
      currentParticipants: 20,
      status: "COMPLETED"
    }
  ],
  registrations: [
    {
      id: 1,
      activityId: 1,
      activityTitle: "数据库使用培训",
      registrationTime: "2024-04-20 10:30:00",
      status: "REGISTERED",
      feedbackRating: null,
      certificateUrl: null
    }
  ]
};

// 渲染使用记录
function renderUsageList() {
  const tbody = document.getElementById('usageList');
  tbody.innerHTML = '';

  resourcesData.usage.forEach(record => {
    const row = document.createElement('tr');
    row.innerHTML =
      '<td>' + record.database + '</td>' +
      '<td><small>' + record.accessTime + '</small></td>' +
      '<td><small>' + record.duration + ' 分钟</small></td>' +
      '<td><small>' + record.searchKeywords + '</small></td>' +
      '<td><small>' + record.documentTitle + '</small></td>' +
      '<td>' +
        '<span class="badge badge-' + getAccessTypeColor(record.accessType) + '">' + getAccessTypeText(record.accessType) + '</span>' +
      '</td>';
    tbody.appendChild(row);
  });
}

// 渲染收藏列表
function renderCollections() {
  const allCollections = document.getElementById('allCollections');
  allCollections.innerHTML = '';

  resourcesData.collections.forEach(item => {
    const col = document.createElement('div');
    col.className = 'col-md-4 mb-3';
    var tagsHtml = '';
    for (var i = 0; i < item.tags.length; i++) {
      tagsHtml += '<span class="badge badge-secondary mr-1">' + item.tags[i] + '</span>';
    }
    col.innerHTML =
      '<div class="card h-100">' +
        '<div class="card-body">' +
          '<h6 class="mb-2">' + item.title + '</h6>' +
          '<small class="text-muted">' + item.author + '</small>' +
          '<div class="mt-2">' + tagsHtml + '</div>' +
          '<div class="mt-2">' +
            '<button type="button" class="btn btn-sm btn-outline-primary" onclick="viewCollection(' + item.id + ')">查看</button>' +
            '<button type="button" class="btn btn-sm btn-outline-secondary" onclick="shareCollection(' + item.id + ')">分享</button>' +
          '</div>' +
        '</div>' +
      '</div>';
    allCollections.appendChild(col);
  });
}

// 渲染笔记列表
function renderNoteList() {
  const noteList = document.getElementById('noteList');
  noteList.innerHTML = '';

  resourcesData.notes.forEach(note => {
    const div = document.createElement('div');
    div.className = 'list-group-item';
    var tagsHtml = '';
    for (var i = 0; i < note.tags.length; i++) {
      tagsHtml += '<span class="badge badge-info mr-1">' + note.tags[i] + '</span>';
    }
    var content = note.content.length > 100 ? note.content.substring(0, 100) + '...' : note.content;
    div.innerHTML =
      '<div class="d-flex justify-content-between align-items-start">' +
        '<div>' +
          '<h6 class="mb-1">' + note.title + '</h6>' +
          '<p class="mb-1">' + content + '</p>' +
          '<div class="mt-2">' + tagsHtml + '</div>' +
        '</div>' +
        '<div>' +
          '<small class="text-muted">' + note.createdTime + '</small><br>' +
          '<small class="text-muted">' + note.wordCount + '字</small>' +
        '</div>' +
      '</div>';
    noteList.appendChild(div);
  });
}

// 渲染报名记录
function renderRegistrationList() {
  const tbody = document.getElementById('registrationList');
  tbody.innerHTML = '';

  resourcesData.registrations.forEach(reg => {
    const activity = resourcesData.trainings.find(t => t.id === reg.activityId);
    if (activity) {
      const row = document.createElement('tr');
      row.innerHTML =
        '<td>' + activity.title + '</td>' +
        '<td><small>' + activity.startTime + '</small></td>' +
        '<td><small>' + activity.location + '</small></td>' +
        '<td><small>' + reg.registrationTime + '</small></td>' +
        '<td>' +
          '<span class="badge badge-' + getRegistrationStatusColor(reg.status) + '">' + getRegistrationStatusText(reg.status) + '</span>' +
        '</td>' +
        '<td>' +
          '<div class="btn-group btn-group-sm">' +
            (reg.status === 'REGISTERED' ? '<button type="button" class="btn btn-outline-warning" onclick="cancelRegistration(' + reg.id + ')">取消</button>' : '') +
            (reg.status === 'COMPLETED' && !reg.certificateUrl ? '<button type="button" class="btn btn-outline-success" onclick="downloadCertificate(' + reg.id + ')">下载证书</button>' : '') +
            '<button type="button" class="btn btn-outline-info" onclick="viewRegistration(' + reg.id + ')">详情</button>' +
          '</div>' +
        '</td>';
      tbody.appendChild(row);
    }
  });
}

// 绘制知识掌握图表
function drawKnowledgeChart() {
  const ctx = document.getElementById('knowledgeChart');
  if (!ctx) return;

  new Chart(ctx, {
    type: 'radar',
    data: {
      labels: ['机器学习', '深度学习', '数据结构', '算法设计', '自然语言处理', '计算机网络'],
      datasets: [{
        label: '知识掌握程度',
        data: [85, 75, 90, 70, 60, 80],
        backgroundColor: 'rgba(54, 162, 235, 0.2)',
        borderColor: 'rgba(54, 162, 235, 1)',
        pointBackgroundColor: 'rgba(54, 162, 235, 1)',
        pointBorderColor: '#fff',
        pointHoverBackgroundColor: '#fff',
        pointHoverBorderColor: 'rgba(54, 162, 235, 1)'
      }]
    },
    options: {
      responsive: true,
      maintainAspectRatio: false,
      aspectRatio: 1.5,
      scale: {
        ticks: {
          beginAtZero: true,
          max: 100
        }
      }
    }
  });
}

// 获取类型颜色
function getAccessTypeColor(type) {
  const colorMap = {
    'VIEW': 'info',
    'DOWNLOAD': 'success',
    'SEARCH': 'primary'
  };
  return colorMap[type] || 'secondary';
}

function getAccessTypeText(type) {
  const textMap = {
    'VIEW': '查看',
    'DOWNLOAD': '下载',
    'SEARCH': '检索'
  };
  return textMap[type] || type;
}

function getRegistrationStatusColor(status) {
  const colorMap = {
    'REGISTERED': 'info',
    'ATTENDED': 'success',
    'ABSENT': 'warning',
    'CANCELLED': 'secondary',
    'COMPLETED': 'success'
  };
  return colorMap[status] || 'secondary';
}

function getRegistrationStatusText(status) {
  const textMap = {
    'REGISTERED': '已报名',
    'ATTENDED': '已参与',
    'ABSENT': '缺席',
    'CANCELLED': '已取消',
    'COMPLETED': '已完成'
  };
  return textMap[status] || status;
}

// 功能函数
function filterUsage() {
  const database = document.getElementById('databaseFilter').value;
  const type = document.getElementById('typeFilter').value;
  const startDate = document.getElementById('startDate').value;
  const endDate = document.getElementById('endDate').value;

  alert('筛选条件：数据库=' + database + ', 类型=' + type + ', 开始日期=' + startDate + ', 结束日期=' + endDate);
}

function showUsageDetails() {
  alert('显示详细的使用统计报告');
}

function showAddCollection() {
  alert('显示添加收藏对话框');
}

function showCategoryManager() {
  alert('显示分类管理对话框');
}

function exportCollections() {
  alert('导出收藏列表为JSON文件');
}

function showNoteEditor() {
  alert('显示笔记编辑器');
}

function showAllTraining() {
  alert('跳转到完整的培训活动列表页面');
}

function downloadCertificate(id) {
  alert('下载培训证书ID: ' + id);
}

function viewRegistration(id) {
  alert('查看报名详情ID: ' + id);
}

function cancelRegistration(id) {
  if (confirm('确定要取消这个报名吗？')) {
    alert('已取消报名ID: ' + id);
  }
}

function viewCollection(id) {
  alert('查看收藏详情ID: ' + id);
}

function shareCollection(id) {
  alert('分享收藏ID: ' + id);
}

function showCreateGroup() {
  alert('显示创建学习小组对话框');
}

function showCreateProject() {
  alert('显示创建项目对话框');
}

function showMyProjects() {
  alert('显示我的项目列表');
}

function showSharedResources() {
  alert('显示共享资源列表');
}

// 页面初始化
document.addEventListener('DOMContentLoaded', function() {
  renderUsageList();
  renderCollections();
  renderNoteList();
  renderRegistrationList();
  drawKnowledgeChart();
});

// API调用统计
axios.get('${api}/channel/view/${channel.id?c}');
</script>

</body>
</html>
[/#escape]
